package str

func canConstruct(ransomNote string, magazine string) bool {
	var c1, c2 [26]int
	for _, v := range ransomNote {
		c1[v-'a']++
	}

	for _, v := range magazine {
		c2[v-'a']++
	}

	for i := range c1 {
		if c1[i] > c2[i] {
			return false
		}
	}

	return true

}
